package com.vhall.component.entity.room.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 投资品种-
 *
 * @author xing.wang
 * @date 2023/8/7
 */
@Getter
@AllArgsConstructor
public enum InvestVarietyEnum implements BaseEnum {
    NO_REQUIREMENT("0", "无要求"),
    FIXED_INCOME("1", "固定收益类投资品种如债券、货币市场基金、债券基金、保本类收益平针等"),
    A_VARIETY("2", "A项所列品种及权益类投资品种如股票、混合型基金、偏股型基金、股票型基金等"),
    A_B_VARIETY("3", "A、B项所列品种及另类投资品种如:信托、激进专项计划等"),
    A_B_C_VARIETY("4", "A、B、C项列品种杠杆类投资品种如融资融券、期货、期权等"),
    A_B_C_D_VARIETY("5", "A、B、C、D项所列品种及复杂或高风险金融产品");
    private final String value;
    private final String name;
    @Override
    public String getValue() {
        return value;
    }
    @Override
    public String getName() {
        return name;
    }
    /**
     * 通过 value 获取 name
     * @param value
     * @return
     */
    public static String getNameByValue(String value) {
        for (InvestVarietyEnum e : InvestVarietyEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getName();
            }
        }
        return null;
    }
}
